package com.smart.village.big.screen.domain;

import java.util.List;

public class MergedPathsResponse {
    private boolean success;

    private String message;

    private List<NewsCategory> tree;

    private List<String> validIds;

    private List<String> invalidIds;

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setTree(List<NewsCategory> tree) {
        this.tree = tree;
    }

    public void setValidIds(List<String> validIds) {
        this.validIds = validIds;
    }

    public void setInvalidIds(List<String> invalidIds) {
        this.invalidIds = invalidIds;
    }


    public String toString() {
        return "MergedPathsResponse(success=" + isSuccess() + ", message=" + getMessage() + ", tree=" + String.valueOf(getTree()) + ", validIds=" + String.valueOf(getValidIds()) + ", invalidIds=" + String.valueOf(getInvalidIds()) + ")";
    }

    public boolean isSuccess() {
        return this.success;
    }

    public String getMessage() {
        return this.message;
    }

    public List<NewsCategory> getTree() {
        return this.tree;
    }

    public List<String> getValidIds() {
        return this.validIds;
    }

    public List<String> getInvalidIds() {
        return this.invalidIds;
    }

    public static MergedPathsResponse success(List<NewsCategory> tree, List<String> validIds, List<String> invalidIds) {
        MergedPathsResponse response = new MergedPathsResponse();
        response.setSuccess(true);
        response.setMessage("+ validIds.size() + ");
        response.setTree(tree);
        response.setValidIds(validIds);
        response.setInvalidIds(invalidIds);
        return response;
    }

    public static MergedPathsResponse error(String message) {
        MergedPathsResponse response = new MergedPathsResponse();
        response.setSuccess(false);
        response.setMessage(message);
        response.setTree(List.of());
        response.setValidIds(List.of());
        response.setInvalidIds(List.of());
        return response;
    }
}
